home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume8 / hint / part02 < prev    next >
Encoding:
Text File  |  1989-08-24  |  26.0 KB  |  819 lines

  1. Newsgroups: comp.sources.misc
  2. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  3. subject: v08i017: hint, an unobtrusive messager, part 2 of 2
  4. Reply-To: edf@ROCKY2.ROCKEFELLER.EDU (David MacKenzie)
  5.  
  6. Posting-number: Volume 8, Issue 17
  7. Submitted-by: edf@ROCKY2.ROCKEFELLER.EDU (David MacKenzie)
  8. Archive-name: hint/part02
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 2 (of 2)."
  17. # Contents:  tty.c clearhint.c Makefile COPYING
  18. # Wrapped by dave@zedfdc on Thu Aug 24 20:10:06 1989
  19. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  20. if test -f 'tty.c' -a "${1}" != "-c" ; then 
  21.   echo shar: Will not clobber existing file \"'tty.c'\"
  22. else
  23. echo shar: Extracting \"'tty.c'\" \(6097 characters\)
  24. sed "s/^X//" >'tty.c' <<'END_OF_FILE'
  25. X/* tty.c -- functions dealing with terminals and termcap
  26. X   Copyright (C) 1989 David MacKenzie
  27. X
  28. X   This program is free software; you can redistribute it and/or modify
  29. X   it under the terms of the GNU General Public License as published by
  30. X   the Free Software Foundation; either version 1, or (at your option)
  31. X   any later version.
  32. X
  33. X   This program is distributed in the hope that it will be useful,
  34. X   but WITHOUT ANY WARRANTY; without even the implied warranty of
  35. X   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  36. X   GNU General Public License for more details.
  37. X
  38. X   You should have received a copy of the GNU General Public License
  39. X   along with this program; if not, write to the Free Software
  40. X   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
  41. X
  42. X#include "hint.h"
  43. X
  44. X/* Termcap codes.  */
  45. Xstatic char *tc_ts;        /* To status line. */
  46. Xstatic char *tc_fs;        /* From status line. */
  47. Xstatic char *tc_ds;        /* Disable (clear) status line. */
  48. Xstatic char *tc_bl;        /* Bell (possibly visual). */
  49. Xstatic short tc_ws;        /* Width (in columns) of status line. */
  50. X
  51. X/* Send the message to `tt->tt_tty'.  Use hinttab to determine what the
  52. X   status line codes for that terminal are.  */
  53. X
  54. Xvoid
  55. Xsendhint (tt)
  56. X     struct ttylist *tt;
  57. X{
  58. X  int fd;
  59. X
  60. X  if (!hintable (tt->tt_tty))
  61. X    {
  62. X      fprintf (stderr, "%s: %s on %s is no longer accepting hints\n",
  63. X           program_name, tt->tt_user, tt->tt_tty);
  64. X      return;
  65. X    }
  66. X  init_buffer ();
  67. X  /* We put the beep here because bells sometimes don't work when in the
  68. X     status line. */
  69. X  tputs (tt->tt_ht.h_bl, 1, buffer_char);
  70. X  tputs (tgoto (tt->tt_ht.h_ts, 0, 0), 1, buffer_char);
  71. X  if (!name_at_end)
  72. X    {
  73. X      buffer_string ("(");
  74. X      buffer_string (whoami ());
  75. X      buffer_string (") ");
  76. X    }
  77. X  buffer_string (message);
  78. X  if (name_at_end)
  79. X    {
  80. X      buffer_string (" - ");;
  81. X      buffer_string (whoami ());
  82. X    }
  83. X  tputs (tt->tt_ht.h_fs, 1, buffer_char);
  84. X
  85. X  fd = open (tt->tt_tty, O_WRONLY);
  86. X  if (fd == -1)
  87. X    pfatal (tt->tt_tty);
  88. X  flush_buffer (fd);
  89. X  close (fd);
  90. X}
  91. X
  92. X/* Erase the hint from `tt->tt_tty'.  */
  93. X
  94. Xvoid
  95. Xerasehint (tt)
  96. X     struct ttylist *tt;
  97. X{
  98. X  int fd;
  99. X
  100. X  init_buffer ();
  101. X  tputs (tt->tt_ht.h_ds, 1, buffer_char);
  102. X
  103. X  fd = open (tt->tt_tty, O_WRONLY);
  104. X  if (fd == -1)
  105. X    pfatal (tt->tt_tty);
  106. X  flush_buffer (fd);
  107. X  close (fd);
  108. X}
  109. X
  110. X/* Return our username.  First try utmp entry; if that fails, use uid.
  111. X   Guaranteed to return a string 8 characters or shorter.  */
  112. X
  113. Xchar *
  114. Xwhoami ()
  115. X{
  116. X  char *me;
  117. X
  118. X  me = getlogin ();
  119. X  if (me == NULL)
  120. X    me = pwname ();
  121. X  if (strlen (me) > 8)
  122. X    me[8] = 0;
  123. X  return me;
  124. X}
  125. X
  126. X/* Return the passwd name based on our uid.  */
  127. X
  128. Xchar *
  129. Xpwname ()
  130. X{
  131. X  struct passwd *pw;
  132. X
  133. X  pw = getpwuid (getuid ());
  134. X  if (pw == NULL)
  135. X    return "";
  136. X  else
  137. X    return pw->pw_name;
  138. X}
  139. X
  140. X/* Set the entry in hinttab for tty `tty' (a full path).
  141. X
  142. X   First we search for an existing (invalid) entry for `tty', and if
  143. X   we find one, we update it.
  144. X
  145. X   If we don't find one, we open the file in
  146. X   APPEND mode, and add a new entry to the end.  Since we're using
  147. X   atomic writes, we don't need to use any special file locking to
  148. X   prevent competing hint processes from writing scrambled entries to
  149. X   the end of the file.  */
  150. X
  151. Xvoid
  152. Xupdatetab (tty)
  153. X     char *tty;
  154. X{
  155. X  static struct hinttab h;
  156. X
  157. X  /* Search the hinttab for an old entry for `tty'. */
  158. X  sethtent ();
  159. X  if (!gethttty (tty))
  160. X    {
  161. X      /* No previous entry for `tty'.  Add one. */
  162. X      endhtent ();
  163. X      sethtapp ();
  164. X    }
  165. X  setup_termcap ();
  166. X  get_speed ();
  167. X  strcpy (h.h_tty, tty);
  168. X  strcpy (h.h_ts, tc_ts);
  169. X  strcpy (h.h_fs, tc_fs);
  170. X  strcpy (h.h_ds, tc_ds);
  171. X  strcpy (h.h_bl, tc_bl);
  172. X  h.h_ws = tc_ws;
  173. X  writehtent (&h);
  174. X  endhtent ();
  175. X}
  176. X
  177. X/* These functions do their best to provide atomic writes, since
  178. X   we don't want our output getting mixed up with that of foreground
  179. X   processes.  They don't check for overflows.  */
  180. X
  181. Xstatic char output_buffer[300];
  182. Xstatic int buffer_length;
  183. X
  184. Xvoid
  185. Xinit_buffer ()
  186. X{
  187. X  buffer_length = 0;
  188. X}
  189. X
  190. Xint
  191. Xbuffer_char (c)
  192. X     int c;
  193. X{
  194. X  output_buffer[buffer_length++] = c;
  195. X}
  196. X
  197. X/* `s' is a null-terminated string. */
  198. X
  199. Xvoid
  200. Xbuffer_string (s)
  201. X     char *s;
  202. X{
  203. X  while (*s)
  204. X    output_buffer[buffer_length++] = *s++;
  205. X}
  206. X
  207. Xvoid
  208. Xflush_buffer (fd)
  209. X     int fd;
  210. X{
  211. X  write (fd, output_buffer, buffer_length);
  212. X}
  213. X
  214. X/* Output speed for tputs. */
  215. Xextern short ospeed;
  216. X
  217. X/* Padding character for tputs. */
  218. Xextern char PC;
  219. X
  220. X/* For tgoto. */
  221. Xextern char *BC, *UP;
  222. X
  223. X/* Raw termcap entry. */
  224. Xstatic char entry[1024];
  225. X
  226. X/* Extracted termcap strings. */
  227. Xstatic char strings[1024];
  228. X
  229. X/* Initialize global termcap strings.  */
  230. X
  231. Xvoid
  232. Xsetup_termcap ()
  233. X{
  234. X  char *tc_pc;            /* Padding character string. */
  235. X
  236. X  if (term == NULL)
  237. X    {
  238. X      fprintf (stderr, "%s: TERM environment variable is not defined\n",
  239. X           program_name);
  240. X      exit (1);
  241. X    }
  242. X  switch (tgetent (entry, term))
  243. X    {
  244. X    case 0:
  245. X      fprintf (stderr,
  246. X           "%s: Terminal type %s is unknown\n", program_name, term);
  247. X      exit (1);
  248. X    case -1:
  249. X      fprintf (stderr,
  250. X       "%s: Cannot open terminal description database\n", program_name);
  251. X      exit (1);
  252. X    }
  253. X
  254. X  /* Re-use term to point to space for next extracted string. */
  255. X  term = strings;
  256. X  tc_pc = tgetstr ("pc", &term);
  257. X  PC = tc_pc ? *tc_pc : 0;
  258. X  BC = UP = NULL;
  259. X  if (tgetflag ("hs"))
  260. X    {
  261. X      /* tgetstr returns NULL if the capability was not found. */
  262. X      tc_ts = tgetstr ("ts", &term);
  263. X      tc_fs = tgetstr ("fs", &term);
  264. X      tc_ds = tgetstr ("ds", &term);
  265. X      tc_ws = tgetnum ("ws");
  266. X      if (tc_ws == -1)
  267. X    tc_ws = DEF_WS;
  268. X    }
  269. X  else
  270. X    {
  271. X      tc_ts = tc_fs = tc_ds = "";
  272. X      tc_ws = DEF_WS;
  273. X    }
  274. X  if (use_vbell)
  275. X    tc_bl = tgetstr ("vb", &term);
  276. X  else
  277. X    tc_bl = NULL;
  278. X  if (use_bell && !tc_bl)
  279. X    {
  280. X      tc_bl = tgetstr ("bl", &term);
  281. X      if (!tc_bl)
  282. X    tc_bl = "\7";
  283. X    }
  284. X  else
  285. X    tc_bl = "";
  286. X}
  287. X
  288. Xvoid
  289. Xget_speed ()
  290. X{
  291. X#ifdef USG
  292. X  struct termio tty_buffer;
  293. X
  294. X  if (ioctl (1, TCGETA, &tty_buffer) != -1)
  295. X    ospeed = tty_buffer.c_cflag & CBAUD;
  296. X#else
  297. X  struct sgttyb tty_buffer;
  298. X
  299. X  if (gtty (1, &tty_buffer) != -1)
  300. X    ospeed = tty_buffer.sg_ospeed;
  301. X#endif
  302. X  else
  303. X    ospeed = 0;
  304. X}
  305. END_OF_FILE
  306. if test 6097 -ne `wc -c <'tty.c'`; then
  307.     echo shar: \"'tty.c'\" unpacked with wrong size!
  308. fi
  309. # end of 'tty.c'
  310. fi
  311. if test -f 'clearhint.c' -a "${1}" != "-c" ; then 
  312.   echo shar: Will not clobber existing file \"'clearhint.c'\"
  313. else
  314. echo shar: Extracting \"'clearhint.c'\" \(2958 characters\)
  315. sed "s/^X//" >'clearhint.c' <<'END_OF_FILE'
  316. X/* clearhint.c -- clear terminal status line
  317. X   Copyright (C) 1989 David MacKenzie
  318. X
  319. X   This program is free software; you can redistribute it and/or modify
  320. X   it under the terms of the GNU General Public License as published by
  321. X   the Free Software Foundation; either version 1, or (at your option)
  322. X   any later version.
  323. X
  324. X   This program is distributed in the hope that it will be useful,
  325. X   but WITHOUT ANY WARRANTY; without even the implied warranty of
  326. X   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  327. X   GNU General Public License for more details.
  328. X
  329. X   You should have received a copy of the GNU General Public License
  330. X   along with this program; if not, write to the Free Software
  331. X   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
  332. X
  333. X/* clearhint - clear terminal status line
  334. X
  335. X   Usage: clearhint [-T terminal]
  336. X
  337. X   David MacKenzie
  338. X   Latest revision: 08/15/89 */
  339. X
  340. X#include <stdio.h>
  341. X#ifdef USG
  342. X#include <termio.h>
  343. X#else
  344. X#include <sgtty.h>
  345. X#endif
  346. X
  347. Xchar *getenv ();
  348. Xchar *tgetstr ();
  349. Xvoid exit ();
  350. X
  351. Xint tcputchar ();
  352. Xvoid getspeed ();
  353. Xvoid usage ();
  354. X
  355. Xextern short ospeed;        /* Output speed of stdout for tputs. */
  356. Xextern char PC;            /* Pad character for tputs. */
  357. X
  358. Xint
  359. Xmain (argc, argv)
  360. X     int argc;
  361. X     char **argv;
  362. X{
  363. X  extern char *optarg;
  364. X  extern int optind;
  365. X  char entry[1024];        /* Raw termcap entry. */
  366. X  char strings[80];        /* Extracted termcap strings. */
  367. X  char *term;            /* Environment variable TERM. */
  368. X  char *next_string;        /* Pointer into strings. */
  369. X  char *tc_ds;            /* Disable status line string. */
  370. X  char *tc_pc;            /* Pad character string. */
  371. X  int c;            /* Option character. */
  372. X
  373. X  term = getenv ("TERM");
  374. X  while ((c = getopt (argc, argv, "T:")) != EOF)
  375. X    if (c == 'T')
  376. X      term = optarg;
  377. X    else
  378. X      usage (argv[0]);
  379. X  if (optind != argc)
  380. X    usage (argv[0]);
  381. X
  382. X  if (term == NULL)
  383. X    {
  384. X      fprintf (stderr,
  385. X           "%s: TERM environment variable is not defined\n", argv[0]);
  386. X      exit (1);
  387. X    }
  388. X
  389. X  switch (tgetent (entry, term))
  390. X    {
  391. X    case 0:
  392. X      fprintf (stderr,
  393. X           "%s: Terminal type %s is unknown\n", argv[0], term);
  394. X      exit (1);
  395. X    case -1:
  396. X      fprintf (stderr,
  397. X           "%s: Cannot open terminal description database\n", argv[0]);
  398. X      exit (1);
  399. X    }
  400. X
  401. X  getspeed ();
  402. X
  403. X  next_string = strings;
  404. X  tc_pc = tgetstr ("pc", &next_string);
  405. X  PC = tc_pc ? *tc_pc : 0;
  406. X  tc_ds = tgetstr ("ds", &next_string);
  407. X  if (tc_ds)
  408. X    {
  409. X      tputs (tc_ds, 1, tcputchar);
  410. X      exit (0);
  411. X    }
  412. X  exit (1);
  413. X  /* NOTREACHED */
  414. X}
  415. X
  416. Xvoid
  417. Xgetspeed ()
  418. X{
  419. X#ifdef USG
  420. X  struct termio tty_buffer;
  421. X
  422. X  if (ioctl (1, TCGETA, &tty_buffer) != -1)
  423. X    ospeed = tty_buffer.c_cflag & CBAUD;
  424. X#else
  425. X  struct sgttyb tty_buffer;
  426. X
  427. X  if (gtty (1, &tty_buffer) != -1)
  428. X    ospeed = tty_buffer.sg_ospeed;
  429. X#endif
  430. X  else
  431. X    ospeed = 0;
  432. X}
  433. X
  434. Xint
  435. Xtcputchar (c)
  436. X     int c;
  437. X{
  438. X  putchar (c & 0x7f);
  439. X  return c;
  440. X}
  441. X
  442. Xvoid
  443. Xusage (program)
  444. X     char *program;
  445. X{
  446. X  fprintf (stderr, "Usage: %s [-T terminal]\n", program);
  447. X  exit (1);
  448. X}
  449. END_OF_FILE
  450. if test 2958 -ne `wc -c <'clearhint.c'`; then
  451.     echo shar: \"'clearhint.c'\" unpacked with wrong size!
  452. fi
  453. # end of 'clearhint.c'
  454. fi
  455. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  456.   echo shar: Will not clobber existing file \"'Makefile'\"
  457. else
  458. echo shar: Extracting \"'Makefile'\" \(1704 characters\)
  459. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  460. X# Makefile for hint
  461. X# David MacKenzie
  462. X# Latest revision: 08/24/89
  463. X
  464. X# Targets:
  465. X# all (default)
  466. X#  Make the executables of hint and clearhint in the current directory.
  467. X# install
  468. X#  Copy the executables into $(BINDIR) and chmod them (must be root).
  469. X# initialize
  470. X#  Create and clear $(DATAFILE).
  471. X# clean
  472. X#  Remove executable, object and temporary files from current directory.
  473. X# lint
  474. X#  Run lint on hint sources with output in LINT.OUT.
  475. X# tags
  476. X#  Run ctags on hint sources.
  477. X# kit
  478. X#  Make shell archive.
  479. X
  480. XSHELL = /bin/sh
  481. X
  482. X# Path of the file containing hint y users' termcap strings.
  483. XDATAFILE = /usr/local/lib/hinttab
  484. X
  485. X# Directory for the binaries to go in.
  486. XBINDIR = /usr/new
  487. X
  488. X# DEFS should include -DUSG on System V.
  489. XDEFS = -DHINTTAB=\"$(DATAFILE)\" -DUSG
  490. XCFLAGS = -O $(DEFS)
  491. XLDFLAGS = -s
  492. X# LIBS should include -ltermcap on BSD, -lcurses on System V.
  493. XLIBS = -lcurses
  494. X
  495. XHDRS  = hint.h
  496. X# Include str.c and str.o on BSD; comment them out on System V.
  497. XSRCS  = main.c hinttab.c stov.c tty.c user.c # str.c
  498. XOBJS  = main.o hinttab.o stov.o tty.o user.o # str.o
  499. X
  500. Xall: hint clearhint
  501. X
  502. Xhint: $(OBJS)
  503. X    $(CC) -o hint $(LDFLAGS) $(OBJS) $(LIBS)
  504. X    chmod 4755 hint
  505. X
  506. X$(OBJS): $(HDRS)
  507. X
  508. X
  509. Xclearhint: clearhint.c
  510. X    $(CC) -o clearhint $(CFLAGS) $(LDFLAGS) clearhint.c $(LIBS)
  511. X
  512. Xinstall: hint clearhint hall.sh
  513. X    cp hint $(BINDIR)/hint
  514. X    chmod 4755 $(BINDIR)/hint
  515. X    cp clearhint $(BINDIR)/clearhint
  516. X    chmod 755 $(BINDIR)/clearhint
  517. X    cp hall.sh $(BINDIR)/hall
  518. X    chmod 755 $(BINDIR)/hall
  519. X
  520. Xinitialize:
  521. X    cat /dev/null > $(DATAFILE)
  522. X    chmod 644 $(DATAFILE)
  523. X
  524. Xclean:
  525. X    rm -f $(OBJS) hint clearhint LINT.OUT tags a.out mon.out core RUNLOG
  526. X
  527. Xlint:
  528. X    lint $(DEFS) $(SRCS) $(LIBS) > LINT.OUT
  529. X
  530. Xtags:    $(SRCS)
  531. X    ctags $(SRCS)
  532. X
  533. Xkit:
  534. X    makekit -m -p -nHint -s40k
  535. END_OF_FILE
  536. if test 1704 -ne `wc -c <'Makefile'`; then
  537.     echo shar: \"'Makefile'\" unpacked with wrong size!
  538. fi
  539. # end of 'Makefile'
  540. fi
  541. if test -f 'COPYING' -a "${1}" != "-c" ; then 
  542.   echo shar: Will not clobber existing file \"'COPYING'\"
  543. else
  544. echo shar: Extracting \"'COPYING'\" \(12488 characters\)
  545. sed "s/^X//" >'COPYING' <<'END_OF_FILE'
  546. X
  547. X            GNU GENERAL PUBLIC LICENSE
  548. X             Version 1, February 1989
  549. X
  550. X Copyright (C) 1989 Free Software Foundation, Inc.
  551. X                    675 Mass Ave, Cambridge, MA 02139, USA
  552. X Everyone is permitted to copy and distribute verbatim copies
  553. X of this license document, but changing it is not allowed.
  554. X
  555. X                Preamble
  556. X
  557. X  The license agreements of most software companies try to keep users
  558. Xat the mercy of those companies.  By contrast, our General Public
  559. XLicense is intended to guarantee your freedom to share and change free
  560. Xsoftware--to make sure the software is free for all its users.  The
  561. XGeneral Public License applies to the Free Software Foundation's
  562. Xsoftware and to any other program whose authors commit to using it.
  563. XYou can use it for your programs, too.
  564. X
  565. X  When we speak of free software, we are referring to freedom, not
  566. Xprice.  Specifically, the General Public License is designed to make
  567. Xsure that you have the freedom to give away or sell copies of free
  568. Xsoftware, that you receive source code or can get it if you want it,
  569. Xthat you can change the software or use pieces of it in new free
  570. Xprograms; and that you know you can do these things.
  571. X
  572. X  To protect your rights, we need to make restrictions that forbid
  573. Xanyone to deny you these rights or to ask you to surrender the rights.
  574. XThese restrictions translate to certain responsibilities for you if you
  575. Xdistribute copies of the software, or if you modify it.
  576. X
  577. X  For example, if you distribute copies of a such a program, whether
  578. Xgratis or for a fee, you must give the recipients all the rights that
  579. Xyou have.  You must make sure that they, too, receive or can get the
  580. Xsource code.  And you must tell them their rights.
  581. X
  582. X  We protect your rights with two steps: (1) copyright the software, and
  583. X(2) offer you this license which gives you legal permission to copy,
  584. Xdistribute and/or modify the software.
  585. X
  586. X  Also, for each author's protection and ours, we want to make certain
  587. Xthat everyone understands that there is no warranty for this free
  588. Xsoftware.  If the software is modified by someone else and passed on, we
  589. Xwant its recipients to know that what they have is not the original, so
  590. Xthat any problems introduced by others will not reflect on the original
  591. Xauthors' reputations.
  592. X
  593. X  The precise terms and conditions for copying, distribution and
  594. Xmodification follow.
  595. X
  596. X            GNU GENERAL PUBLIC LICENSE
  597. X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  598. X
  599. X  0. This License Agreement applies to any program or other work which
  600. Xcontains a notice placed by the copyright holder saying it may be
  601. Xdistributed under the terms of this General Public License.  The
  602. X"Program", below, refers to any such program or work, and a "work based
  603. Xon the Program" means either the Program or any work containing the
  604. XProgram or a portion of it, either verbatim or with modifications.  Each
  605. Xlicensee is addressed as "you".
  606. X
  607. X  1. You may copy and distribute verbatim copies of the Program's source
  608. Xcode as you receive it, in any medium, provided that you conspicuously and
  609. Xappropriately publish on each copy an appropriate copyright notice and
  610. Xdisclaimer of warranty; keep intact all the notices that refer to this
  611. XGeneral Public License and to the absence of any warranty; and give any
  612. Xother recipients of the Program a copy of this General Public License
  613. Xalong with the Program.  You may charge a fee for the physical act of
  614. Xtransferring a copy.
  615. X
  616. X  2. You may modify your copy or copies of the Program or any portion of
  617. Xit, and copy and distribute such modifications under the terms of Paragraph
  618. X1 above, provided that you also do the following:
  619. X
  620. X    a) cause the modified files to carry prominent notices stating that
  621. X    you changed the files and the date of any change; and
  622. X
  623. X    b) cause the whole of any work that you distribute or publish, that
  624. X    in whole or in part contains the Program or any part thereof, either
  625. X    with or without modifications, to be licensed at no charge to all
  626. X    third parties under the terms of this General Public License (except
  627. X    that you may choose to grant warranty protection to some or all
  628. X    third parties, at your option).
  629. X
  630. X    c) If the modified program normally reads commands interactively when
  631. X    run, you must cause it, when started running for such interactive use
  632. X    in the simplest and most usual way, to print or display an
  633. X    announcement including an appropriate copyright notice and a notice
  634. X    that there is no warranty (or else, saying that you provide a
  635. X    warranty) and that users may redistribute the program under these
  636. X    conditions, and telling the user how to view a copy of this General
  637. X    Public License.
  638. X
  639. X    d) You may charge a fee for the physical act of transferring a
  640. X    copy, and you may at your option offer warranty protection in
  641. X    exchange for a fee.
  642. X
  643. XMere aggregation of another independent work with the Program (or its
  644. Xderivative) on a volume of a storage or distribution medium does not bring
  645. Xthe other work under the scope of these terms.
  646. X
  647. X  3. You may copy and distribute the Program (or a portion or derivative of
  648. Xit, under Paragraph 2) in object code or executable form under the terms of
  649. XParagraphs 1 and 2 above provided that you also do one of the following:
  650. X
  651. X    a) accompany it with the complete corresponding machine-readable
  652. X    source code, which must be distributed under the terms of
  653. X    Paragraphs 1 and 2 above; or,
  654. X
  655. X    b) accompany it with a written offer, valid for at least three
  656. X    years, to give any third party free (except for a nominal charge
  657. X    for the cost of distribution) a complete machine-readable copy of the
  658. X    corresponding source code, to be distributed under the terms of
  659. X    Paragraphs 1 and 2 above; or,
  660. X
  661. X    c) accompany it with the information you received as to where the
  662. X    corresponding source code may be obtained.  (This alternative is
  663. X    allowed only for noncommercial distribution and only if you
  664. X    received the program in object code or executable form alone.)
  665. X
  666. XSource code for a work means the preferred form of the work for making
  667. Xmodifications to it.  For an executable file, complete source code means
  668. Xall the source code for all modules it contains; but, as a special
  669. Xexception, it need not include source code for modules which are standard
  670. Xlibraries that accompany the operating system on which the executable
  671. Xfile runs, or for standard header files or definitions files that
  672. Xaccompany that operating system.
  673. X
  674. X  4. You may not copy, modify, sublicense, distribute or transfer the
  675. XProgram except as expressly provided under this General Public License.
  676. XAny attempt otherwise to copy, modify, sublicense, distribute or transfer
  677. Xthe Program is void, and will automatically terminate your rights to use
  678. Xthe Program under this License.  However, parties who have received
  679. Xcopies, or rights to use copies, from you under this General Public
  680. XLicense will not have their licenses terminated so long as such parties
  681. Xremain in full compliance.
  682. X
  683. X  5. By copying, distributing or modifying the Program (or any work based
  684. Xon the Program) you indicate your acceptance of this license to do so,
  685. Xand all its terms and conditions.
  686. X
  687. X  6. Each time you redistribute the Program (or any work based on the
  688. XProgram), the recipient automatically receives a license from the original
  689. Xlicensor to copy, distribute or modify the Program subject to these
  690. Xterms and conditions.  You may not impose any further restrictions on the
  691. Xrecipients' exercise of the rights granted herein.
  692. X
  693. X  7. The Free Software Foundation may publish revised and/or new versions
  694. Xof the General Public License from time to time.  Such new versions will
  695. Xbe similar in spirit to the present version, but may differ in detail to
  696. Xaddress new problems or concerns.
  697. X
  698. XEach version is given a distinguishing version number.  If the Program
  699. Xspecifies a version number of the license which applies to it and "any
  700. Xlater version", you have the option of following the terms and conditions
  701. Xeither of that version or of any later version published by the Free
  702. XSoftware Foundation.  If the Program does not specify a version number of
  703. Xthe license, you may choose any version ever published by the Free Software
  704. XFoundation.
  705. X
  706. X  8. If you wish to incorporate parts of the Program into other free
  707. Xprograms whose distribution conditions are different, write to the author
  708. Xto ask for permission.  For software which is copyrighted by the Free
  709. XSoftware Foundation, write to the Free Software Foundation; we sometimes
  710. Xmake exceptions for this.  Our decision will be guided by the two goals
  711. Xof preserving the free status of all derivatives of our free software and
  712. Xof promoting the sharing and reuse of software generally.
  713. X
  714. X                NO WARRANTY
  715. X
  716. X  9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  717. XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  718. XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  719. XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  720. XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  721. XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  722. XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  723. XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  724. XREPAIR OR CORRECTION.
  725. X
  726. X  10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  727. XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  728. XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  729. XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  730. XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  731. XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  732. XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  733. XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  734. XPOSSIBILITY OF SUCH DAMAGES.
  735. X
  736. X             END OF TERMS AND CONDITIONS
  737. X
  738. X    Appendix: How to Apply These Terms to Your New Programs
  739. X
  740. X  If you develop a new program, and you want it to be of the greatest
  741. Xpossible use to humanity, the best way to achieve this is to make it
  742. Xfree software which everyone can redistribute and change under these
  743. Xterms.
  744. X
  745. X  To do so, attach the following notices to the program.  It is safest to
  746. Xattach them to the start of each source file to most effectively convey
  747. Xthe exclusion of warranty; and each file should have at least the
  748. X"copyright" line and a pointer to where the full notice is found.
  749. X
  750. X    <one line to give the program's name and a brief idea of what it does.>
  751. X    Copyright (C) 19yy  <name of author>
  752. X
  753. X    This program is free software; you can redistribute it and/or modify
  754. X    it under the terms of the GNU General Public License as published by
  755. X    the Free Software Foundation; either version 1, or (at your option)
  756. X    any later version.
  757. X
  758. X    This program is distributed in the hope that it will be useful,
  759. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  760. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  761. X    GNU General Public License for more details.
  762. X
  763. X    You should have received a copy of the GNU General Public License
  764. X    along with this program; if not, write to the Free Software
  765. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  766. X
  767. XAlso add information on how to contact you by electronic and paper mail.
  768. X
  769. XIf the program is interactive, make it output a short notice like this
  770. Xwhen it starts in an interactive mode:
  771. X
  772. X    Gnomovision version 69, Copyright (C) 19xx name of author
  773. X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  774. X    This is free software, and you are welcome to redistribute it
  775. X    under certain conditions; type `show c' for details.
  776. X
  777. XThe hypothetical commands `show w' and `show c' should show the
  778. Xappropriate parts of the General Public License.  Of course, the
  779. Xcommands you use may be called something other than `show w' and `show
  780. Xc'; they could even be mouse-clicks or menu items--whatever suits your
  781. Xprogram.
  782. X
  783. XYou should also get your employer (if you work as a programmer) or your
  784. Xschool, if any, to sign a "copyright disclaimer" for the program, if
  785. Xnecessary.  Here a sample; alter the names:
  786. X
  787. X  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  788. X  program `Gnomovision' (a program to direct compilers to make passes
  789. X  at assemblers) written by James Hacker.
  790. X
  791. X  <signature of Ty Coon>, 1 April 1989
  792. X  Ty Coon, President of Vice
  793. X
  794. XThat's all there is to it!
  795. END_OF_FILE
  796. if test 12488 -ne `wc -c <'COPYING'`; then
  797.     echo shar: \"'COPYING'\" unpacked with wrong size!
  798. fi
  799. # end of 'COPYING'
  800. fi
  801. echo shar: End of archive 2 \(of 2\).
  802. cp /dev/null ark2isdone
  803. MISSING=""
  804. for I in 1 2 ; do
  805.     if test ! -f ark${I}isdone ; then
  806.     MISSING="${MISSING} ${I}"
  807.     fi
  808. done
  809. if test "${MISSING}" = "" ; then
  810.     echo You have unpacked both archives.
  811.     rm -f ark[1-9]isdone
  812. else
  813.     echo You still need to unpack the following archives:
  814.     echo "        " ${MISSING}
  815. fi
  816. ##  End of shell archive.
  817. exit 0
  818.  
  819.